﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Krist_em_up.Interface
{
    public class TextureButton : Button
    {
        protected Texture2D Texture;

        //protected override Vector2 Position;

        protected Rectangle SourceRectangle;

        public TextureButton(Texture2D text, Vector2 position) : base(Vector2.Zero, "")
        {
            Texture = text;
            this.position = position;
            Unfocus();
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();
            spriteBatch.Draw(Texture, position, SourceRectangle, Color.White);
            spriteBatch.End();
        }
        internal new void Unfocus()
        {
            SourceRectangle = new Rectangle(0, 0, Texture.Width, Texture.Height / 2);
        }
        internal new void Focus()
        {
            SourceRectangle = new Rectangle(0, Texture.Height / 2, Texture.Width, Texture.Height / 2);
        }
    }
}
